package com.jx.db137.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jx.db137.common.R;
import com.jx.db137.entity.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author jx
 * @version 1.0
 * @Description
 * @date 2024/12/24 11:42
 */
@Repository
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    @Select("select distinct(c.id),c.label,c.brief,c.imgicon,c.parentid from userrole a \n" +
            "inner join rolemenu b \n" +
            "on a.roleid=b.roleid \n" +
            "inner join menu c \n" +
            "on b.menuid=c.id where a.userid=1")
    List<Menu> getMenusByUserId(int userid);

    List<Menu> selectMenuName(@Param("label") String label);
}
